From: Philip Withnall Date: Tue, 28 May 2024 17:08:27 +0000 (+0100) Subject: shell-camera-monitor: Fix warning about strict aliasing X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~226^2^2~106 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=37e49e8a22c223b030297f9607bdb748c219e060;p=gnome-shell.git shell-camera-monitor: Fix warning about strict aliasing Changing type when casting a double pointer is not strictly allowed in C. In order to fix compilation with `-fstrict-aliasing`, don’t use `g_clear_pointer()` for clearing this pointer where the type expected by the destroy notify function does not match the type stored in the `ShellCameraMonitor` struct. This introduces no functional changes. Signed-off-by: Philip Withnall Part-of: --- diff --git a/src/shell-camera-monitor.c b/src/shell-camera-monitor.c index 1e2e0f145..b2e6e0b2a 100644 --- a/src/shell-camera-monitor.c +++ b/src/shell-camera-monitor.c @@ -298,7 +298,11 @@ shell_camera_monitor_disconnect_core (ShellCameraMonitor *monitor) g_clear_handle_id (&monitor->delayed_disable_id, g_source_remove); spa_hook_remove (&monitor->registry_listener); - g_clear_pointer ((struct pw_proxy**) &monitor->registry, pw_proxy_destroy); + if (monitor->registry != NULL) + { + pw_proxy_destroy ((struct pw_proxy *) monitor->registry); + monitor->registry = NULL; + } spa_hook_remove (&monitor->core_listener); g_clear_pointer (&monitor->core, pw_core_disconnect); }